package com.feihao.zhou.demoVolatileUseSynchronized;

public class MyThread2 implements Runnable {
    private Money money;

    public MyThread2(Money money) {
        this.money = money;
    }

    @Override
    public void run() {
        synchronized (money) {
            try {
                Thread.sleep(200);
                money.setMoney(90000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
